<template>
    <div class="box">
      <div class="top">
        <h3>{{info.title}}</h3>
        <span>20阅读</span>
      </div>
      <div class="content">
        {{info.content}}
      </div>
    </div>
</template>

<script>
import * as info from '../api/info'
export default {
  name: 'article-detail',
  data () {
    return {
      info: {}
    }
  },
  mounted () {
    this.getInfo()
  },
  methods: {
    getInfo () {
      const id = this.$route.query.id
      info.getArticles(id).then(res => {
        console.log(info)
        this.info = res.data
      })
    }
  }
}
</script>

<style scoped>
.box{
  padding: .3rem;
}
  .top{
    padding: .3rem 0;
    text-align: center;
    border-bottom: 1px solid #ddd;
  }
  .top h3{
    font-size: .44rem;
    font-weight: bold;
    color: #000;
    margin-bottom: .1rem;
  }
  .content{
    padding: .3rem .2rem;
  }
  .content p{
    font-size: .38rem;
    color: #333;
    line-height: .66rem;
    text-indent: 20px;
  }
</style>
